<template>
  <div class="common-layout">
    <el-container>
      <el-header style="background-color:aqua;">
         <span style="font-size: 30px;">智慧酒店(专高3)</span>
      </el-header>
      <el-container>
        <el-aside width="200px">
            <el-menu
               active-text-color="#ffd04b"
               background-color="#545c64"
               class="el-menu-vertical-demo"
               :default-active="route.path"
               text-color="#fff"
               router
               >
               <el-sub-menu index="1">
                  <template #title>
                     <el-icon><location /></el-icon>
                     <span>默认任务</span>
                  </template>
                  <el-menu-item-group>
                     <el-menu-item index="1-1">HomeView</el-menu-item>
                     <el-menu-item index="1-2">AboutView</el-menu-item>
                  </el-menu-item-group>
               </el-sub-menu>

               <el-sub-menu index="2">
                  <template #title>
                     <el-icon><icon-menu /></el-icon>
                     <span>商品任务</span>
                  </template>
                  <el-menu-item-group>
                     <el-menu-item index="/AddGoods">商品录入</el-menu-item>
                     <el-menu-item index="/ShowGoods">商品列表</el-menu-item>
                  </el-menu-item-group>
               </el-sub-menu>


               <el-sub-menu index="3">
                  <template #title>
                  <el-icon><document /></el-icon>
                     <span>权限任务</span>
                  </template>
               <el-menu-item-group>
                     <el-menu-item index="/memberAdd">会员录入</el-menu-item>
                     <el-menu-item index="/memberList">会员列表</el-menu-item>
                     <el-menu-item index="/AddRolePermission">角色录入</el-menu-item>
                     <el-menu-item index="1-2">角色列表</el-menu-item>
                  </el-menu-item-group>
               </el-sub-menu>
                             

               <el-sub-menu index="3">
                  <template #title>
                   <el-icon><setting /></el-icon>
                     <span>入住任务</span>
                  </template>
               <el-menu-item-group>
                     <el-menu-item index="/ShowOrder">订单列表</el-menu-item>
                  </el-menu-item-group>
               </el-sub-menu>

               </el-menu>
        </el-aside>

        <!-- 显示组件的核心部分 -->
        <el-main>
            <RouterView/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import router from '@/router';
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
import {useRoute,RouterView} from 'vue-router'

const route=useRoute();
</script>

<style>
.el-header {
    height: 60px;
    line-height: 60px;
    background-color: rgb(37 82 209);
    color: #fff;
}

.el-aside {
    min-height: calc(100vh - 60px);
    background-color: #545c64;
}

.el-menu--horizontal {
  --el-menu-horizontal-height: 100px;
}
</style>
